// pages/me/message/message.js
Page({
  data:{
    userInfo:{},
    openid:""
  },
  getUserInfo: function (e) {
    const that=this
    wx.cloud.callFunction({
      name: "login",
      success: res => {
        that.setData({
          userInfo:e.detail.userInfo,
          openid:res.result.openid
        })
        //将两个变量合并
        that.data.userInfo.openid = that.data.openid
        //存入缓存
        wx.setStorageSync('userInfo', that.data.userInfo)
        wx.switchTab({
          url: '/pages/me/me',
        })
      },
      fail: res => {
        console.log("云函数调用失败")
      }
    })
  }
})